<!-- Raggiungibile con: http://fcaliumi.web.cs.unibo.it/pw/new-test/caio-wip/Caio-ProvaWorkInspecor.xhtml --> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
	xml:lang="en" >
	<head>
		<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
		<title>Pagina di prova per la WorkInspector (web 2.0 ammina!)</title>

		<script type = "text/javascript" src = "../../ac/globalVariables.js"/>
		<script type = "text/javascript" src = "../../ac/catalogFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/dataSourceFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/dataFormatterFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/mainFunctions.js"/>
		<script type = "text/javascript" src = "debugFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/postFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/queryFunction.js"/>
		<script type = "text/javascript" src = "../../al/ResponseHandler.js"/>
		<script type = "text/javascript" src = "../../al/callbackFunctions.js"/>
		<script type = "text/javascript" src = "../../ac/appendinoFunctions.js"/>
		<script type = "text/javascript" src = "../../al/ContentManager.js"/>
		<script type = "text/javascript" src = "../../al/eventHandlers.js"/>
		<script type = "text/javascript" src = "../../al/devilResponse.js"/>
		<script type = "text/javascript" src = "../../al/AnalizeWork.js"/>
		<script type = "text/javascript" src = "../../al/WorkInspector.js"/>
		<!--<script type = "text/javascript" src = "../../../mootools-1.2-core.js"/>
		-->
		
		<script type = "text/javascript">
			//<![CDATA[
			function main()
			{
				ds[0] = new DataSource (crescentina);
				curDF = 0;
				df[0] = new DataFormatter (piadina);
				cm = new ContentManager ();
				cm.reset ();
				putDebText("Parto ;)");
				
				var wInspector = new WorkInspector(function(){putDebText("Onready: prova superata")});
				
				ds[0].query("etitle[0]=Sia+fatta+la+sua+volontà",
					null,
					function(xhr){
						var res = xhr.responseXML;
						var metas= res.getElementsByTagName('metadati')[0];
						if(!metas) alert("Nessun risultato per la ricerca!");
						putOnScreen(metas,"query-result",false);
						if (wInspector.isReady()) {
							putDebText("Condizione verificata, work inspector ready");
							wInspector.drawAnalysis(metas);
							putDebText("Operazione compleatata");
						}
						else {
							putDebText("Siam nell'else");
							wInspector.onready = function(){
								wInspector.drawAnalysis(metas);
							}
						}
					},
					function(xhr){
						abortPoli("eccheccazzo, XMLHttpRequest error code: "+xhr.status);
					});

			}
			
			//]]>
		</script>
		
	</head>
	<body onload="main()">
		<div id="messaggi-debug"></div>
	</body>
</html>
